﻿using System.Windows.Forms;

namespace LD.Host.项目
{
    public partial class CtlSLOT : UserControl
    {
        public CtlSLOT()
        {
            InitializeComponent();
        }

        private string statemsg;

        public string StateMsg
        {
            get { return statemsg; }
            set
            {
                statemsg = value;
                this.lab_state.Text = "状态:" + value;
            }
        }
        private string slot;

        public string Slot
        {
            get { return slot; }
            set
            {
                slot = value;
                this.btn_slot.Text = value;
            }
        }

        private string barcode;

        public string Barcode
        {
            get { return barcode; }
            set
            {
                barcode = value;
                this.lab_barcode.Text = "条码:" + value;
            }
        }
        private KazamState state;

        public KazamState State
        {
            get { return state; }
            set { state = value;
                switch (state)
                {
                    case KazamState.Start:
                        this.btn_slot.ButtonType = ReaLTaiizor.Util.HopeButtonType.Primary;
                        break;
                    case KazamState.Testing:
                        this.btn_slot.ButtonType = ReaLTaiizor.Util.HopeButtonType.Success;
                        break;
                    case KazamState.Complated:
                        this.btn_slot.ButtonType = ReaLTaiizor.Util.HopeButtonType.Info;
                        break;
                    case KazamState.Error:
                        this.btn_slot.ButtonType = ReaLTaiizor.Util.HopeButtonType.Danger;
                        break;
                    default:
                        break;
                }
                this.Refresh();
            }
        }

    }

    public enum KazamState
    {
        Start,
        Testing,
        Complated,
        Error
    }
}
